package klok;

import java.util.Observable;

public class ObserverVoorbeeld extends Observable{

	public static void main(String[] args){
		ObserverVoorbeeld o = new ObserverVoorbeeld();
		Observertje s1 = new Observertje();
		o.addObserver(s1);
		o.go();
	}
	public void go(){
		while(true){
			try{
				Thread.sleep(5000);
				setChanged();
				notifyObservers("Plof");
				clearChanged();
			}catch(InterruptedException e){
				System.out.println(e.getStackTrace());
			}
		}
	}
}
